import java.util.Arrays;

class Student implements Comparable{
    private String name;
    private  double score;

    public Student(String name, double score) {
        this.name = name;
        this.score = score;
    }
    @Override
    public String toString() {
        return "student{" +
                "name='" + name + '\'' +
                ", score=" + score +
                '}';
    }
    public int compareTo(Object o){
        Student s=(Student)o;
        if(this.score<s.score){
            return -1;
        }else if(this.score>s.score){
            return 1;
        }else{
            return 0;
        }
    }
}

public class Main {
    public static void main(String[] args) {
        Student[] s={new Student("小明",93),
                     new Student("小红",95),
                     new Student("小王",100),
                     new Student("小张",98)
        };
        Arrays.sort(s);
        System.out.println(Arrays.toString(s));
    }
}